<?php

class metricsController {
	
	function __construct() {
	}
	public function index() {		
		if( !Tools::isAjax() ) return;
		session_start();		
		$model = new metrics;
		$data = $model->select();
		echo json_encode( $data );
	}
	
	public function find() {		
		if( !Tools::isAjax() ) return;
		session_start();		
		$model = new metrics;
		$data = $model->find();
		echo json_encode( $data );
	}
	
	public function insert() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new metrics;
		$data = $model->insert();
		echo json_encode( $data );
	}
	
	public function update() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new metrics;
		$data = $model->update();
		echo json_encode( $data );
	}
	
	public function delete() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new metrics;
		$data = $model->delete();
		echo json_encode( $data );
	}

	public function jsload() {		
		if( !Tools::isAjax() ) return;
		App::me()->js_load('metrics.js');
	}	
	
}
?>